Fix numerous instances of shadowing confusion. (#570)
Fix numerous instances of shadowing confusion.
Inspired by a cppcon talk and our recent conversations about warnings, I
took a closer look at shadowing variables in our code and I wasn't proud
of my findings.
We had a lot of code that was writing to local variables or function
arguments when it thought it was operating on globals or (soon)
method-member variables. I made a rather half-hearted pass at changing
this by splitting up huge functions, renaming arguments, renaming globals
to reflect their future status as method variables (foo_), and generally
cleaning things up. The amound of effort I spent on each format was
approximately equal to its expected lifespan - I'm not spending an hour
on cleanups on formats I should instead be deleting.
In a future submit, I'll try to find some combination of -W flags on
our targets that allows us to not regress easily.
34 files changed: